<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="js/xView-min.js"></script>
<script type="text/javascript" src="js/layer.js"></script>
<!-- 引入自定义的组件 -->
<script type="text/javascript" src="js/xView-widget.js"></script>

<script type="text/javascript">

//自定义组件


//询问框
function selectMan(){
	layer.confirm('<ul> <li>张三</li>'
			 +' <li>李四</li>'
			  +'<li>王五</li></ul>', {
		  btn: ['确定','取消'] //按钮
		}, function(i){
			layer.close(i)
		//模拟获取到的员工数据
		 var item = {name:"张三",id:"1"}
			alert("选中了："+tiem.name);
		xView.val($("#mySelect"),item);
			
		},function(){});

	
}


</script>


</head>
<body>
<div>自定义组件</div>
<div id="model">
<div id="mySelect" x-view="mySelect" x-name="time" data-view="">
<input class = "view-input" type="text">
<input type="button" value="选择员工" onclick="selectMan()">
</div>
</div>

</body>
</html>